package com.only4play.practice.usercenter.core.entity;

import com.only4play.codegen.processor.creator.IgnoreCreator;
import com.only4play.codegen.processor.updater.IgnoreUpdater;
import com.only4play.codegen.support.annotation.FieldDesc;
import com.only4play.codegen.support.constants.ValidStatus;
import com.only4play.codegen.support.model.BaseEntity;
import lombok.Data;

@Data
public class AdminUserRole extends BaseEntity {

  @FieldDesc(name = "用户id")
  private Long userId;

  @FieldDesc(name = "角色Id")
  private Long roleId;

  @FieldDesc(name = "使用状态")
  @IgnoreUpdater
  @IgnoreCreator
  private ValidStatus validStatus;

  public void init() {
    setValidStatus(ValidStatus.VALID);
  }

  public void valid(){
    setValidStatus(ValidStatus.VALID);
  }

  public void invalid(){
    setValidStatus(ValidStatus.INVALID);
  }
}
